useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.6.0_22'

	if window('Protocol Buffer Editor'):
##		select('File_Txt', r'C:\Users\BruceTst/.RecordEditor/ProtoBuf\SampleFiles/testExt01b.bin')
		select('File_Txt', commonBits.sampleDir() + 'xTestExt03b.bin')
##		select('Proto Definition_Txt', r'C:\Users\BruceTst\.RecordEditor\ProtoBuf\CopyBook\Extension03a.proto')
		select('File Structure_Txt', 'Single Message')
##		click('Edit1')
		select('Proto Definition_Txt', commonBits.stdCopybookDir() + 'Extension03.proto')
		click('Edit1')
		select('TabbedPane', 'Record: ')
		select('LineFrameTree.FileDisplay_JTbl', '123', 'Data,0')
		select('LineFrameTree.FileDisplay_JTbl', 'n 123', 'Data,1')
		select('LineFrameTree.FileDisplay_JTbl', 'cell:Data,1()')
		click('New2')

		if window('Record Selection'):
			click('OK')
		close()

		select('TabbedPane', 'Record:')
		select('LineFrameTree.FileDisplay_JTbl1', '456', 'Data,0')
		select('LineFrameTree.FileDisplay_JTbl1', 'n 456', 'Data,1')
		select('LineFrameTree.FileDisplay_JTbl1', 'cell:Text,1(n 456)')
		assert_p('LineFrameTree.FileDisplay_JTbl1', 'Content', '[[B, 1, , UINT64, 456, 456], [eventName, 1, , STRING, n 456, n 456], [qtab, 2, , STRING, [], []]]')
		select('LineFrameTree.FileDisplay_JTbl1', 'cell:Text,1(n 456)')
		click('New3')
##		select('TabbedPane', 'Record:')
		select('LineFrameTree.FileDisplay_JTbl2', '1234', 'Data,0')
		select('LineFrameTree.FileDisplay_JTbl2', 'cell:Text,0(1234)')
		
		assert_p('LineFrameTree.FileDisplay_JTbl2', 'Content', '[[text, 1, , STRING, 1234, 1234]]')

		select('LineFrameTree.FileDisplay_JTbl2', 'cell:Text,0(1234)')
		click('Tree View')
		select('TabbedPane', 'Tree View')
##		select('LineTreeChild.FileDisplay_JTbl', '')
		rightclick('LineTreeChild.FileDisplay_JTbl', 'Tree,0')
		select_menu('Fully Expand Tree')
		assert_p('LineTreeChild.FileDisplay_JTbl', 'Content', '[[, , 123, n 123], [, , , ], [, , , ]]')
		select('LineTreeChild.Layouts_Txt', 'Prefered')
		assert_p('LineTreeChild.FileDisplay_JTbl', 'Content', '[[, , 123, n 123, ], [, , 456, n 456, []], [, , 1234, , ]]')
		select('LineTreeChild.FileDisplay_JTbl', 'cell:Tree,0(null)')
		rightclick('LineTreeChild.FileDisplay_JTbl', 'Tree,0')
		select('LineTreeChild.FileDisplay_JTbl', 'cell:Tree,0(null)')
		click('New1')
##		select('TabbedPane', 'Record:')
		select('LineFrameTree.FileDisplay_JTbl3', 'nnnn', 'Data,0')
		select('LineFrameTree.FileDisplay_JTbl3', 'cell:Text,0(nnnn)')
		assert_p('LineFrameTree.FileDisplay_JTbl3', 'Content', '[[text, 1, , STRING, nnnn, nnnn]]')
		select('LineFrameTree.FileDisplay_JTbl3', 'cell:Text,0(nnnn)')
		click('Tree View')
		select('TabbedPane', 'Tree View')
##		select('LineTreeChild.FileDisplay_JTbl', '')
		rightclick('LineTreeChild.FileDisplay_JTbl', 'Tree,0')
		select_menu('Fully Expand Tree')
		assert_p('LineTreeChild.FileDisplay_JTbl', 'Content', '[[, , 123, n 123, ], [, , 456, n 456, []], [, , 1234, , ], [, , , , ], [, , nnnn, , ]]')
		select('LineTreeChild.FileDisplay_JTbl', 'cell:Tree,0(null)')
		click('New1')
##		select('TabbedPane', 'Record:')
		select('LineFrameTree.FileDisplay_JTbl4', '45678', 'Data,0')
		select('LineFrameTree.FileDisplay_JTbl4', 'cell:Text,0(45678)')
		assert_p('LineFrameTree.FileDisplay_JTbl4', 'Content', '[[text, 1, , STRING, 45678, 45678]]')
		select('LineFrameTree.FileDisplay_JTbl4', 'cell:Text,0(45678)')
		click('Tree View')
		select('TabbedPane', 'Tree View')
		assert_p('LineTreeChild.FileDisplay_JTbl', 'Content', '[[, , 123, n 123, ], [, , 456, n 456, []], [, , 1234, , ], [, , , , ], [, , nnnn, , ], [, , 45678, , ]]')
		click('Save1')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		click('Edit1')
		assert_p('LineTreeChild.FileDisplay_JTbl', 'Content', '[[, , 123, n 123], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ]]')
		select('LineTreeChild.Layouts_Txt', 'Prefered')
		assert_p('LineTreeChild.FileDisplay_JTbl', 'Content', '[[, , 123, n 123, ], [, , 456, n 456, []], [, , 1234, , ], [, , , , ], [, , nnnn, , ], [, , 45678, , ]]')
		select('LineTreeChild.FileDisplay_JTbl', 'cell:Tree,0(null)')
		click('Delete2')
		click('Save1')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
	close()
